package com.coderman.basketball.app.executor;

import com.coderman.basketball.app.command.activity.SignUpCommand;
import com.coderman.basketball.app.converter.ActivityConverter;
import com.coderman.basketball.domain.gataway.activity.ActivityService;
import com.coderman.basketball.domain.model.activity.SignUpRecordBO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Description:
 * date: 2021/5/20
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class SignUpExecutor {
    @Autowired
    private ActivityService activityService;
    @Transactional(rollbackFor = Exception.class)
    public String exeCommand(SignUpCommand signUpCommand){
        SignUpRecordBO signUpRecordBO = ActivityConverter.INSTANCE.dto2bo(signUpCommand.getSignUpDTO());
        activityService.signUpShow(signUpRecordBO);
        return "";
    }

}
